package com.example.kotlinstudy

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.ViewGroup
import android.widget.Button
import android.widget.LinearLayout
import android.widget.TextView

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {

        super.onCreate(savedInstanceState)

        var layout = LinearLayout(this)
        setContentView(layout)

        layout.orientation = LinearLayout.VERTICAL
        var show = TextView(this)
        var bt = Button(this)

        bt.setText(R.string.ok)
        bt.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT,)
        layout.addView(bt)
        layout.addView(show)
        bt.setOnClickListener {
            show.text = "Hello , Android ,"+java.util.Date()
        }

        var draw = DrawView(this)
        draw.minimumWidth = 300
        draw.minimumHeight = 500
        layout.addView(draw)

    }
}